//
//  ZaiquanTableViewCell.m
//  盘盈贷1.2
//
//  Created by iOS on 15/3/6.
//  Copyright (c) 2015年 iOS. All rights reserved.
//

#import "ZaiquanTableViewCell.h"

@implementation ZaiquanTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.nameTitle = [[UILabel alloc] init];
        [self.contentView addSubview:self.nameTitle];
        [self.nameTitle release];
        
        self.name = [[UILabel alloc] init];
        [self.contentView addSubview:self.name];
        [self.name release];
        
        self.name1 = [[UILabel alloc] init];
        [self.contentView addSubview:self.name1];
        [self.name1 release];
        
        self.zhuanrangjine = [[UILabel alloc] init];
        [self.contentView addSubview:self.zhuanrangjine];
        [self.zhuanrangjine release];
        
        self.zhuanrangjine1 = [[UILabel alloc] init];
        [self.contentView addSubview:self.zhuanrangjine1];
        [self.zhuanrangjine1 release];
        
        self.yuanbiaoqixian = [[UILabel alloc] init];
        [self.contentView addSubview:self.yuanbiaoqixian];
        [self.yuanbiaoqixian release];
        
        self.yuanbiaoqixian1 = [[UILabel alloc] init];
        [self.contentView addSubview:self.yuanbiaoqixian1];
        [self.yuanbiaoqixian1 release];
        
        self.nianhualiyi = [[UILabel alloc] init];
        [self.contentView addSubview:self.nianhualiyi];
        [self.nianhualiyi release];
        
        self.nianhualiyi1 = [[UILabel alloc] init];
        [self.contentView addSubview:self.nianhualiyi1];
        [self.nianhualiyi1 release];
        
        self.shengyujine = [[UILabel alloc] init];
        [self.contentView addSubview:self.shengyujine];
        [self.shengyujine release];
        
        self.shengyujine1 = [[UILabel alloc] init];
        [self.contentView addSubview:self.shengyujine1];
        [self.shengyujine1 release];
        
        self.shengyiqixian = [[UILabel alloc] init];
        [self.contentView addSubview:self.shengyiqixian];
        [self.shengyiqixian release];
        
        self.shengyiqixian1 = [[UILabel alloc] init];
        [self.contentView addSubview:self.shengyiqixian1];
        [self.shengyiqixian1 release];
        
        self.rate = [[UILabel alloc] init];
        [self.contentView addSubview:self.rate];
        [self.rate release];
        
        
        UIView *bottomView = [[UIView alloc] initWithFrame:CGRectMake(0, 30, 320, 70)];
        self.progress = [[UIProgressView alloc] initWithProgressViewStyle:UIProgressViewStyleBar];
        self.progress.frame = CGRectMake(20, 90, 290, 120);
        self.progress.backgroundColor = [UIColor lightGrayColor];
        self.progress.tintColor = [UIColor redColor];
        [bottomView addSubview:self.progress];
        [self.contentView addSubview:bottomView];
        [self.progress release];
        
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.nameTitle.frame = CGRectMake(10, 3, 250, 27);
    self.nameTitle.font = [UIFont fontWithName:@"Helvetica-Bold" size:17];
    self.name.frame = CGRectMake(13, 35, 30, 20);
    self.name.text = @"姓名";
    self.name.font = [UIFont systemFontOfSize:14];
    self.name.textColor = [UIColor grayColor];
    self.name1.frame = CGRectMake(50, 35, 40, 20);
    self.name1.font = [UIFont systemFontOfSize:14];
    self.name1.textColor = [UIColor orangeColor];
    self.zhuanrangjine.frame = CGRectMake(13, 60, 60, 20);
    self.zhuanrangjine.font = [UIFont systemFontOfSize:14];
    self.zhuanrangjine.text = @"转让金额";
    self.zhuanrangjine.textColor = [UIColor grayColor];
    self.zhuanrangjine1.font = [UIFont systemFontOfSize:14];
    self.zhuanrangjine1.frame = CGRectMake(75, 60, 70, 20);
    self.zhuanrangjine1.textColor = [UIColor orangeColor];
    self.yuanbiaoqixian.frame = CGRectMake(13, 85, 60, 20);
    self.yuanbiaoqixian.font = [UIFont systemFontOfSize:14];
    self.yuanbiaoqixian.textColor = [UIColor grayColor];
    self.yuanbiaoqixian.text = @"原标期限";
    self.yuanbiaoqixian1.font = [UIFont systemFontOfSize:14];
    self.yuanbiaoqixian1.frame = CGRectMake(75, 85, 70, 20);
    self.yuanbiaoqixian1.textColor = [UIColor orangeColor];
    
    
    self.nianhualiyi.frame = CGRectMake(170, 35, 100, 20);
    self.nianhualiyi.font = [UIFont systemFontOfSize:14];
    self.nianhualiyi.textColor = [UIColor grayColor];
    self.nianhualiyi.text = @"年化收益";
    self.nianhualiyi1.font = [UIFont systemFontOfSize:14];
    self.nianhualiyi1.frame = CGRectMake(240, 35, 70, 20);
    self.nianhualiyi1.textColor = [UIColor orangeColor];
    
    self.shengyujine.frame = CGRectMake(170, 60, 60, 20);
    self.shengyujine.font = [UIFont systemFontOfSize:14];
    self.shengyujine.textColor = [UIColor grayColor];
    self.shengyujine.text = @"剩余金额";
    self.shengyujine1.font = [UIFont systemFontOfSize:14];
    self.shengyujine1.frame = CGRectMake(240, 60, 70, 20);
    self.shengyujine1.textColor = [UIColor orangeColor];
    
    self.shengyiqixian.frame = CGRectMake(170, 85, 60, 20);
    self.shengyiqixian.font = [UIFont systemFontOfSize:14];
    self.shengyiqixian.textColor = [UIColor grayColor];
    self.shengyiqixian.text = @"剩余期限";
    self.shengyiqixian1.font = [UIFont systemFontOfSize:14];
    self.shengyiqixian1.frame = CGRectMake(240, 85, 70, 20);
    self.shengyiqixian1.textColor = [UIColor orangeColor];
    NSInteger a = [self.zaiquan.BidAmount floatValue];
    NSInteger b = [self.zaiquan.Amount floatValue];
    [self.progress setProgress : a / b];
    
    self.rate.frame = CGRectMake(320, 100, 50, 30);
    self.rate.textColor = [UIColor grayColor];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
